# $Id: PKGBUILD 151296 2012-02-25 13:15:04Z pierre $
# Maintainer: Dale Blount <dale@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: François Charette <francois.archlinux.org>

pkgname=perl-mail-spf
_realname=Mail-SPF
pkgver=2.8.0
pkgrel=1
pkgdesc="Perl module that provides SPF support"
arch=('any')
license=('custom')
url="http://search.cpan.org/dist/${_realname}/"
# Used for testing only.
makedepends=('perl-net-dns-resolver-programmable')
depends=('perl-error' 'perl-netaddr-ip' 'perl-uri' 'perl-net-dns' 'perl')
conflicts=('perl-mail-spf-query')
source=("http://search.cpan.org/CPAN/authors/id/J/JM/JMEHNLE/mail-spf/${_realname}-v${pkgver}.tar.gz")
options=('!emptydirs')
md5sums=('4f5bbd59058da680bfd9ff18e31489b7')

build() {
  cd ${srcdir}/${_realname}-v${pkgver}
  # Fix required perl-net-dns-resolver-programmable version
  #sed "s/=> 'v0.002.1',/=> 0,/" -i Build.PL
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${srcdir}/${_realname}-v${pkgver}
  make test
}

package() {
  cd ${srcdir}/${_realname}-v${pkgver}
  make DESTDIR=${pkgdir} install
  find ${pkgdir} -name '.packlist' -delete
  find ${pkgdir} -name 'perllocal.pod' -delete
  install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
